package com.apphome.rbac.domain;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * The persistent class for the t_users_roles database table.
 * 
 */
@Entity
@Table(name="t_users_roles")
public class UsersRole implements Serializable {
	private static final long serialVersionUID = 1L;
	private String id;
	private Timestamp createTime;
	private Object enabled;
	private Timestamp lastupdateTime;
	private User user;
	private List<Role> roles;

	public UsersRole() {
	}


	@Id
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}


	@Column(name="CREATE_TIME")
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}


	public Object getEnabled() {
		return this.enabled;
	}

	public void setEnabled(Object enabled) {
		this.enabled = enabled;
	}


	@Column(name="LASTUPDATE_TIME")
	public Timestamp getLastupdateTime() {
		return this.lastupdateTime;
	}

	public void setLastupdateTime(Timestamp lastupdateTime) {
		this.lastupdateTime = lastupdateTime;
	}


	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="USER_ID")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}


	//bi-directional many-to-one association to Role
	@OneToMany(mappedBy="usersRole")
	public List<Role> getRoles() {
		return this.roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

}